import { Controller, UseGuards, Get, Post, Body, Param, Query, HttpCode } from '@nestjs/common';
import { EventLogService } from './event-log.service';
import { CreateEventLogDto } from './dto/create-event-log.dto'; // 假设你已经创建了这个 DTO
// import { Public } from '../common/public.decorator';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';

@Controller('b/api/eventLog')
export class EventLogController {
    constructor(private readonly eventLogService: EventLogService) {}

    @Post('/add')
      @UseGuards(JwtAuthGuard)
    //   @Public()
      @HttpCode(200)
      create(@Body() data: CreateEventLogDto) {
        return this.eventLogService.create(data);
      }


      @Get()
      //   @Public() // 随便查用户
       @UseGuards(JwtAuthGuard)
        findAll(@Query() query: any) {
          return this.eventLogService.findAll(query);
        }

}
